#ifndef FLASH_API_H__
#define FLASH_API_H__

#include "user_extern.h"
#include <time.h>


void falsh_spiffs_init(void);
uint8_t flash_set_value_i8(char *table, char *name, uint8_t value);
uint8_t flash_get_value_i8(char *table, char *name, int8_t *value);
uint8_t flash_set_value_i16(char *table, char *name, uint16_t value);
uint8_t flash_get_value_i16(char *table, char *name, int16_t *value);
uint8_t flash_set_value_str(char *table, char *name, char *value);
uint8_t flash_get_value_str(char *table, char *name, char *value, size_t *len);
uint8_t flash_commit(void);

#define SYSTEM_VALUE    "system"
#define DIGIMON_VALUE    "digimon"

#define SYS_FIRST_INIT      "0"
#define SYS_SNTP_EN         "1"
#define SYS_ALARM_EN        "2"
#define SYS_ALARM_HOU       "2.1"
#define SYS_ALARM_MIN       "2.2"
#define SYS_WEATHER         "3"
#define SYS_LIGHT_LEVEL     "4"
#define SYSTEM_VOICE_EN     "5"
#define SYSTEM_WEATHER_PROVINCE "6"
#define SYSTEM_WEATHER_CITY     "7"
#define SYSTEM_WIFI_ENABLE  "8"
#define SYSTEM_WIFI_SSID    "9"
#define SYSTEM_WIFI_PASS    "10"
#define SYSTEM_WIFI_SSID_LEN    "11"
#define SYSTEM_WIFI_PASS_LEN    "12"
#define SYS_CTL_VOICE_ONOFF "11"


#endif /*FLASH_API_H__*/